//Artigo de Jiang 2010
#ifndef IMPROVEDVERLET_H
#define IMPROVEDVERLET_H
#include "integrationMethod.h"


class ImprovedVerlet: public IntegrationMethod
{
    public:
        ImprovedVerlet();
        ImprovedVerlet(double, double, std::vector<State>, std::vector< std::vector<Particle *> > &, std::vector< std::vector<Spring *> > &, bool, int, double,  double,  double, Vector3D);
        ~ImprovedVerlet();

        void calculate(bool, unsigned int, double);

        void setEta(double _e) {eta = _e;}

    private:
        double eta;
        std::vector<Vector *> resultantForce;
        std::vector<Vector *> previousResultantForce;
        std::vector<Vector> previousAcceleration;

        State f(const State &, unsigned int);
        Vector acceleration(const State &, unsigned int);
        Vector3D particleResultanteForce(const State &, const Vector3D &, const Vector3D &, unsigned int, unsigned int);
        Vector3D particleAcceleration(double, const Vector3D &);
        void verlet(State *, double, Vector3D, const Vector3D &, const Vector3D &, unsigned int, unsigned int);
        void beemanAlgorithm(State *, double, Vector3D, const Vector3D&, const Vector3D& , unsigned int, unsigned int);
        Vector3D corrector(const Vector3D&, double, const Vector3D&, const Vector3D&, const Vector3D&);

};

#endif // IMPROVEDVERLET_H

